package dealer;

import java.util.ArrayList;

public   class Inventory{
	 
	 private ArrayList<InventoryItem> InventoryList; 
	 

	 public Inventory(){
		 InventoryList = new ArrayList<InventoryItem>();
	 }	 
	 
	 void addItem(String good, int amount, int price){
		 InventoryItem item;
		 
		 InventoryList.add(new InventoryItem(good, amount, price));
		 item = InventoryList.get(InventoryList.size()-1);

		 
	 }
	 
	 
	 
	 
	 void removeItem(String good, int amount){
		 
	 }
	 

	 public InventoryItem getItemByName(String good){
		 
		 InventoryItem theItem = new InventoryItem("-", 0, 0);
		 
		 boolean gotoNext=true;
		 int i=0;
		 int size = InventoryList.size();
		 
		 while (gotoNext){
			

			 theItem = InventoryList.get(i);
			 
			 if (theItem.Name.equals(good)) {
				 gotoNext=false;
				 i++;
			 }
		 }

		 return theItem;
	 }
	 
 }









